// import request from '@/utils/request'
/**
 * 实现新增部分功能
* @param  data
*
*/
import request from '@/utils/request'
export function addDepartment(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// import request from '@/utils/request'
/**
 * 实现查询部门功能
* @param  data
*/

export function getDepartments() {
  return request({
    url: '/company/department',
    method: 'get'
  })
}
// import request from '@/utils/request'
/**
 * 实现根据传入数据里的id修改部分功能
* @param {data.id} data
*/

export function updateDepartment(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// import request from '@/utils/request'
/**
 * 实现根据传入部门id部分实现删除功能
* @param {id} data
*/

export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
// import request from '@/utils/request'
/**
 * 实现根据传入部门id部分实现查询功能
* @param {id} data
*/

export function getDepartmentByid(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'get'
  })
}

